<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>添加工程</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    {CSS href="__ADDONSTATIC__css/font.css" /}
    {CSS href="__ADDONSTATIC__css/xadmin.css" /}
    {js href='__ADDONSTATIC__js/jquery-3.2.1.min.js' /}
    {CSS href="__ADDONSTATIC__css/css.css" /}

    {js href='__ADDONSTATIC__js/xadmin.js' /}
    {js href='__ADDONSTATIC__js/util.js' /}
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    {js href='__ADDONSTATIC__lib/layui/layui.js' /}
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-body">
    <form class="layui-form">
        <input type="hidden" id="id" name="id" value="{$project.id}">
        <div class="layui-form-item">
            <label for="name" class="layui-form-label">
                <span class="x-red">*</span>项目名称
            </label>
            <div class="layui-input-inline">
                <input type="text" id="name" name="name" value="{$project.name}" required="" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="manager" class="layui-form-label">
                项目经理
            </label>
            <div class="layui-input-inline">
                <input type="text" id="manager" name="manager" value="{$project.manager}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="developers" class="layui-form-label">
                开发商
            </label>
            <div class="layui-input-inline">
                <input type="text" id="developers" name="developers" value="{$project.developers}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="developersCharge" class="layui-form-label">
                开发商负责人
            </label>
            <div class="layui-input-inline">
                <input type="text" id="developersCharge" name="developersCharge"  value="{$project.developersCharge}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="chargePhone" class="layui-form-label">
                <span class="x-red">*</span>负责人手机
            </label>
            <div class="layui-input-inline">
                <input type="text" id="chargePhone" name="chargePhone"  value="{$project.chargePhone}" required="" lay-verify="phone"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="position" class="layui-form-label">
                坐落位置
            </label>
            <div class="layui-input-inline">
                <input type="text" id="position" name="position" value="{$project.position}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="position" class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="update" lay-submit="">
                修改
            </button>

            <!--<a class="layui-btn" style="color: #fff;margin-left: 100px" href="{:addonUrl(Admin/projectList)}" >返回</a>-->
        </div>
    </form>
</div>

<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form, layer = layui.layer;

        //监听提交
        form.on('submit(update)', function (data) {
            layer.confirm('确认修改',{},function(){
                ajaxUrl("{:addonUrl(Admin/updateHlProject)}",data.field,function(res){
                    layer.alert(res.message, {}, function (index) {
                        layer.close(index);
                        if(res.code == 1){
                            x_admin_close();
                        }
                    })
                });
            })
            return false;
        });
    });
</script>
</body>

</html>